home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 25 / Cream of the Crop 25.iso / program / vol16n09.zip / MFCTIP.ZIP / GRAY.TXT next >
Text File  |  1997-04-14  |  423b  |  14 lines

  1. void CMyView::OnDraw (CDC* pDC)
  2. {
  3.     CBrush brush;
  4.     if ((pDC->GetDeviceCaps (NUMCOLORS) == 2) &&
  5.         (pDC->m_hDC != pDC->m_hAttribDC))
  6.         brush.CreateSolidBrush (RGB (76, 76, 76)); // Grayscale red
  7.     else
  8.         brush.CreateSolidBrush (RGB (255, 0, 0)); // Genuine red
  9.  
  10.     CBrush* pOldBrush = pDC->SelectObject (&brush);
  11.     pDC->Ellipse (0, 0, 400, 200);
  12.     pDC->SelectObject (pOldBrush);
  13. }
  14.